﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
using Tools;
using Wp.DAL;

namespace Wp.BLL
{
    /// <summary>
    /// Summary description for Per_ActionsRoles
    /// </summary>
    public class TblPostMetaManager : TblPostMetaManagerBase
    {
        public TblPostMetaManager()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        public static TblPostMetaManager CreateInstant()
        {
            return new TblPostMetaManager();
        }
        public List<TblPostMetaEntity> SelectByPostId(int PostId)
        {
            List<SqlParameter> ls = new List<SqlParameter>();
            ls.Add(new SqlParameter("@PostId", PostId));
            SqlParameter[] sqlparam = ls.ToArray();
            DataTable dt = SqlHelper.ExecuteDataTable(SqlHelper.WpConnectString, CommandType.StoredProcedure, "wp_SelectTblPostMetaByPostId", sqlparam);
            List<TblPostMetaEntity> lsresult = new List<TblPostMetaEntity>();
            if (dt != null && dt.Rows.Count > 0)
                for (int i = 0; i < dt.Rows.Count; i++)
                    lsresult.Add(GetTblPostMetaEntity(dt.Rows[i]));
            return lsresult;
        }
    }
}
